<% include("/admin/header.html", {active : 'music'}){} %>
<!--装载文件-->
<link rel="stylesheet" type="text/css" href="${cdn}/assets/uploadify/uploadify.css" />
<link rel="stylesheet" type="text/css" href="${cdn}/assets/js/validator-0.7.3/jquery.validator.css">

<form id="upload_music_form" action="##" class="form-horizontal" role="form"
	method="post" autocomplete="off">
	<legend>编辑音乐</legend>
	<div class="form-group">
		<label class="col-md-2 control-label required">音乐名称：</label>
		<div class="col-md-4">
			<input type="text" name="song" id="song" value="${music.song!}"
				class="form-control" placeholder="请输入音乐名称">
		</div>
	</div>
	<div class="form-group">
		<label class="col-md-2 control-label">歌手名称：</label>
		<div class="col-md-4">
			<input type="text" name="singer" id="singer" value="${music.singer!}"
				placeholder="请输入歌手名称" class="form-control"
				style="cursor: auto; background-image: url(); background-attachment: scroll; background-position: 100% 50%; background-repeat: no-repeat;">
		</div>
	</div>
	<div class="form-group">
		<label class="col-md-2 control-label">音乐描述：</label>
		<div class="col-md-4">
			<textarea name="introduce" id="introduce" rows="2"
				class="form-control" placeholder="请输入歌曲描述">${music.introduce!}</textarea>
		</div>
	</div>
	<div class="form-group">
		<label class="col-md-2 control-label required">选择分类：</label>
		<div class="col-md-4">
			 <%
			 	if(null != music.mcatList!){
			 		for(cat in catList!){
			 			var flag = 0;
			 			var catId = cat.id + '';
						for(mcat in music.mcatList!){
							if(mcat == catId){
								flag = 1;
								break;
							}
						}
						if(flag == 1){%>
							<button name="cidbtn" type="button" class="btn" ok="1" cid="${cat.id}" onclick="$unique.admin.music.tabok(this)">${cat.name!} <i class="icon-ok"></i></button>
						<%} else{%>
							<button name="cidbtn" type="button" class="btn" ok="0" cid="${cat.id}" onclick="$unique.admin.music.tabok(this)">${cat.name!} <i class="icon-ok hide"></i></button>
						<%}
					}
			 	} else{
			 		for(cat in catList!){%>
						<button name="cidbtn" type="button" class="btn" ok="0" cid="${cat.id}" ok="false" onclick="$unique.admin.music.tabok(this)">${cat.name} <i class="icon-ok hide"></i></button>
					<%}
			 }%>
		</div>
	</div>
	<div class="form-group">
		<label class="col-md-2 control-label">所属专辑：</label>
		<div class="col-md-4">
			<%for(special in specialList!){
				if(special.id == music.sid!){%>
					<label class="radio-inline"> <input type="radio" checked="checked" name="sid" value="${special.id}"> ${special.title!} </label> &nbsp;&nbsp;
				<%} else{%>
					<label class="radio-inline"> <input type="radio" name="sid" value="${special.id}"> ${special.title!} </label> &nbsp;&nbsp;
				<%}
			} %>
			<label class="radio-inline"> <input type="radio" name="sid" value=""> 无</label>
		</div>
	</div>
	<div class="form-group">
		<label class="col-md-2 control-label required">插入音乐：</label>
		<div class="col-md-4">
			<input type="text" name="song_path" id="song_path" value="${music.mp3_url!}"
				class="form-control" placeholder="请输入音乐地址">
		</div>
	</div>
	
	<div class="form-group">
		<label class="col-md-2 control-label">上传音乐文件：</label>
		<div class="col-md-4">
			<div id="fileQueue"></div>
			<input type="file" name="uploadify" id="uploadify" />
		</div>
	</div>

	<div class="form-group">
		<label class="col-md-2 control-label required">插入图片：</label>
		<div class="col-md-4">
			<input type="text" name="cover_path" id="cover_path" value="${music.cover_url!}"
				class="form-control" placeholder="请输入图片地址">
		</div>
	</div>
	
	<div class="form-group">
		<label class="col-md-2 control-label">上传图片文件：</label>
		<div class="col-md-4">
			<div id="fileQueue2"></div>
			<input type="file" name="uploadify" id="uploadify2" />
		</div>
	</div>
	
	<div class="form-group">
		<label class="col-md-2 control-label">歌曲歌词：</label>
		<div class="col-md-8">
		    <script id="lrc" name="lrc" type="text/plain">${music.lrc!}</script>
		</div>
	</div>
	
	<div class="form-group">
		<div class="col-md-offset-2 col-md-10">
			<input type="button" class="btn" value="返回上级" onclick="window.location.href='${base}/admin/music'">
			<input type="submit" id="submit" class="btn btn-primary" value="保存音乐" data-loading="请稍候...">
			<input type="hidden" name="cids" id="cids" value="">
			<input type="hidden" name="step" value="submit">
			<input type="hidden" name="mid" value="${music.id!}">
		</div>
	</div>
</form>

<script type="text/javascript" src="${cdn}/assets/uploadify/jquery.uploadify.min.js"></script>
<script type="text/javascript" src="${cdn}/assets/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="${cdn}/assets/ueditor/ueditor.all.min.js"></script>
<% include("/admin/footer.html",{jsList:['admin/edit_music.js']}){} %>
